﻿@model List<article_category>

@{
    ViewData["Title"] = "文章分类列表";
    var list = Model;
}

<div class="row">
    <div class="col-md-12">

        <div class="row">
            <div class="col-md-6">
                <a class="btn btn-primary ladda-button" href="@Url.Action("Add")">添加文章分类</a>
            </div>
        </div>

        <table class="@ViewHelper.Standard_table_css">
            <thead>
                <tr>
                    <th data-column-name="@nameof(article_category.category_name)">分类名称</th>
                    <th data-column-name="@nameof(article_category.img)">图标</th>
                    <th data-column-name="@nameof(article_category.sort)">排序</th>
                    <th data-column-name="@nameof(article_category.is_show)">是否显示</th>
                    <th data-column-name="@nameof(article_hot.create_time)">创建时间</th>
                    <th data-column-name="@nameof(article_hot.last_update)">更新时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                @{
                    if (list.Count > 0)
                    {
                        foreach (var item in list)
                        {
                            var href = Url.Action("Detail", new { id = item.id });
                            <tr data-id="@item.id">
                                <td title="分类设置"><a href="@href">@item.category_name</a></td>
                                <td><a href="@item.img" target="_blank" title="查看图片-@(item.img)">查看图片</a></td>
                                <td>@item.sort</td>
                                <td>@(item.is_show ? "显示" : "隐藏")</td>
                                <td>@item.create_time.ToLocalDateTimeString()</td>
                                <td>@item.last_update.ToLocalDateTimeString()</td>
                                <td>
                                    <a href="@Url.Action("ArticleList",new { id = item.id })" target="_blank">查看内容列表</a>
                                </td>
                            </tr>
                        }
                    }
                    else
                    {
                        @Html.Raw(ViewHelper.Standard_no_record_tr)
                    }
                }
            </tbody>
        </table>
    </div>
</div>

